      SUBROUTINE DEFSTA(INDE,ILEN,CNAM,FOK) 
C For statement class INDE returns length of FORTRAN
C keyword (ILEN), keyword name (CNAM*25) and logical
C FOK, which is set if the statement is to be checked   
C for embedded blanks.  
C INPUT ; INDE  
C OUTPUT; ILEN  
C         CNAM  
C         FOK   
C   
      include 'PARAM.h' 
      include 'USUNIT.h' 
      CHARACTER*25 CNAM 
      LOGICAL FOK   
      PARAMETER (LFOK=37)   
      DIMENSION IFOK(LFOK)  
      CHARACTER CFORTS(MXSTAT)*25   
      DATA CFORTS(  1)/'ASSIGN                   '/ 
      DATA CFORTS(  2)/'BACKSPACE                '/ 
      DATA CFORTS(  3)/'BLOCKDATA                '/ 
      DATA CFORTS(  4)/'BUFFERIN                 '/ 
      DATA CFORTS(  5)/'BUFFEROUT                '/ 
      DATA CFORTS(  6)/'CONTINUE                 '/ 
      DATA CFORTS(  7)/'CALL                     '/ 
      DATA CFORTS(  8)/'COMMON                   '/ 
      DATA CFORTS(  9)/'COMPLEXFUNCTION          '/ 
      DATA CFORTS( 10)/'COMPLEX                  '/ 
      DATA CFORTS( 11)/'COMPLEX                  '/ 
      DATA CFORTS( 12)/'CHARACTERFUNCTION        '/ 
      DATA CFORTS( 13)/'CHARACTER                '/ 
      DATA CFORTS( 14)/'CHARACTER                '/ 
      DATA CFORTS( 15)/'CLOSE                    '/ 
      DATA CFORTS( 16)/'DATA                     '/ 
      DATA CFORTS( 17)/'DIMENSION                '/ 
      DATA CFORTS( 18)/'DO                       '/ 
      DATA CFORTS( 19)/'DO                       '/ 
      DATA CFORTS( 20)/'DECODE                   '/ 
      DATA CFORTS( 21)/'DOUBLEPRECISIONFUNCTION  '/ 
      DATA CFORTS( 22)/'DOUBLEPRECISION          '/ 
      DATA CFORTS( 23)/'END                      '/ 
      DATA CFORTS( 24)/'ENDIF                    '/ 
      DATA CFORTS( 25)/'ENDFILE                  '/ 
      DATA CFORTS( 26)/'ENTRY                    '/ 
      DATA CFORTS( 27)/'EQUIVALENCE              '/ 
      DATA CFORTS( 28)/'EXTERNAL                 '/ 
      DATA CFORTS( 29)/'ELSE                     '/ 
      DATA CFORTS( 30)/'ELSEIF                   '/ 
      DATA CFORTS( 31)/'ENCODE                   '/ 
      DATA CFORTS( 32)/'FORMAT                   '/ 
      DATA CFORTS( 33)/'FUNCTION                 '/ 
      DATA CFORTS( 34)/'GOTO                     '/ 
      DATA CFORTS( 35)/'GOTO                     '/ 
      DATA CFORTS( 36)/'GOTO                     '/ 
      DATA CFORTS( 37)/'IF                       '/ 
      DATA CFORTS( 38)/'IF                       '/ 
      DATA CFORTS( 39)/'IF                       '/ 
      DATA CFORTS( 40)/'ILLEGAL                  '/ 
      DATA CFORTS( 41)/'INTEGERFUNCTION          '/ 
      DATA CFORTS( 42)/'INTEGER                  '/ 
      DATA CFORTS( 43)/'INTEGER                  '/ 
      DATA CFORTS( 44)/'IMPLICIT                 '/ 
      DATA CFORTS( 45)/'INQUIRE                  '/ 
      DATA CFORTS( 46)/'INTRINSIC                '/ 
      DATA CFORTS( 47)/'LOGICALFUNCTION          '/ 
      DATA CFORTS( 48)/'LOGICAL                  '/ 
      DATA CFORTS( 49)/'LOGICAL                  '/ 
      DATA CFORTS( 50)/'LEVEL                    '/ 
      DATA CFORTS( 51)/'NAMELIST                 '/ 
      DATA CFORTS( 52)/'OPEN                     '/ 
      DATA CFORTS( 53)/'PRINT                    '/ 
      DATA CFORTS( 54)/'PARAMETER                '/ 
      DATA CFORTS( 55)/'PAUSE                    '/ 
      DATA CFORTS( 56)/'PROGRAM                  '/ 
      DATA CFORTS( 57)/'PUNCH                    '/ 
      DATA CFORTS( 58)/'READ                     '/ 
      DATA CFORTS( 59)/'READ                     '/ 
      DATA CFORTS( 60)/'REALFUNCTION             '/ 
      DATA CFORTS( 61)/'REAL                     '/ 
      DATA CFORTS( 62)/'REAL                     '/ 
      DATA CFORTS( 63)/'RETURN                   '/ 
      DATA CFORTS( 64)/'REWIND                   '/ 
      DATA CFORTS( 65)/'SAVE                     '/ 
      DATA CFORTS( 66)/'STOP                     '/ 
      DATA CFORTS( 67)/'SUBROUTINE               '/ 
      DATA CFORTS( 68)/'WRITE                    '/ 
      DATA CFORTS( 69)/'ASSIGNMENT               '/ 
      DATA CFORTS( 70)/'ASSIGNMENT               '/ 
      DATA CFORTS( 71)/'ASSIGNMENT               '/ 
C   
      DATA IFOK /13,31,32,42,48,52,53,54,57,58,59,61, 68,69,70,71,30,34,
     +35,36,37,38,39,8,9,12,21,22,24,41,47,60,14,43,49,62,11/   
      FOK = .FALSE. 
      IF(INDE.GT.MXSTAT.OR.INDE.LT.1) THEN  
         WRITE(MZUNIT,500)  
         RETURN 
      ENDIF 
      DO 10 I=1,LFOK
         IF(INDE.EQ.IFOK(I)) RETURN 
   10 CONTINUE  
      FOK = .TRUE.  
      CNAM = CFORTS(INDE)   
      ILEN = INDEX(CNAM,' ')-1  
      RETURN
  500 FORMAT(1X,'!!! NON-FATAL ERROR IN DEFSTA')
      END   
